﻿using Biz;
using BusinessLayer.Dal;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BusinessLayer.Biz
{
    public class Unsold
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public DateTime Time { get; set; }
        public int QuantityImport { get; set; }
        public int QuantityExport { get; set; }
        public int QuantityUnsold { get; set; }
        public virtual Product Product { get; set; }
        UnsoldDal dal = new UnsoldDal();
        public void Insert()
        {
            dal.Insert(this);
        }

        public int GetQuantityByProduct(Product product)
        {
            return dal.GetQuantityByProduct(product);
        }
        public TonKho GetByProduct(Product product, DateTime fromdate, DateTime todate)
        {
            return dal.GetByProduct(product, fromdate, todate);
        }
    }
}
